package spring.superrun.record.mvc.dto;

import com.fasterxml.jackson.annotation.JsonProperty;

public class WeChatLoginDto {

    /**
     * 错误码翻译
     * @return
     */
    public String ParseErrCode(){
        switch (this.Errcode){
            case -1: return "系统繁忙，此时请开发者稍候再试";
            case 0: return "请求成功";
            case 40029: return "code 无效";
            case 45011: return "频率限制，每个用户每分钟100次";
            default: return "其他错误Code为："+Errcode;
        }
    }
    /// <summary>
    /// 用户唯一标识
    /// </summary>
    @JsonProperty("openid")
    private String OpenId ;
    /// <summary>
    /// 会话密钥
    /// </summary>
    @JsonProperty("session_key")
    private String Session_Key ;
    /// <summary>
    /// 用户在该平台的唯一标识
    /// </summary>
    private String Unionid ;
    /// <summary>
    /// 错误码
    /// </summary>
    @JsonProperty("errcode")
    private int Errcode ;
    /// <summary>
    /// 错误信息
    /// </summary>
    @JsonProperty("errmsg")
    private String Errmsg ;

    public String getOpenId() {
        return OpenId;
    }

    public void setOpenId(String openId) {
        OpenId = openId;
    }

    public String getSession_Key() {
        return Session_Key;
    }

    public void setSession_Key(String session_Key) {
        Session_Key = session_Key;
    }

    public String getUnionid() {
        return Unionid;
    }

    public void setUnionid(String unionid) {
        Unionid = unionid;
    }
    public int getErrcode() {
       return Errcode;
    }
    public void setErrcode(int errcode) {
        Errcode = errcode;
    }

    public String getErrmsg() {
        return Errmsg;
    }

    public void setErrmsg(String errmsg) {
        Errmsg = errmsg;
    }
}
